package com.lw;

import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.Player;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class Music {

    public Music(){
        Player player;
        String str = System.getProperty("user.dir")+"/src/music/bg.mp3";
        try {
            BufferedInputStream bis = new BufferedInputStream(new FileInputStream(str));
            player = new Player(bis);
            player.play();
        } catch (FileNotFoundException e) {
            System.out.println(e);
        } catch (JavaLayerException e) {
            System.out.println(e);
        }
    }
}
